home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 1.6 KB | 55 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Programmer: Kent Sandvik
- Date: 12/14/92
- Revision comments are at the end of this file.
- ---
- TTimer is a simple timing class that could provide both 10 lap time values as well as
- final values.
- TTimerTest.cp contains the TTimer test functions.
- _________________________________________________________________________________________________________ */
-
- #ifndef _TIMER_
- #include "Timer.h"
- #endif
-
- // This simple test is testing out the TTimer class, taking lap values as well
- // as final values.
-
- const kSecond = 60; // definition of a second
-
-
- void main(void)
- {
- cout << "Start of TTimer test…\n";
-
- // create a TTimer class
- TTimer myTimer;
-
- myTimer.Start();
- Delay(kSecond * 1, NULL); // 1 second delay
-
- cout << "Get Lap time = " << myTimer.GetLap() << " ticks\n";
-
- myTimer.SetLap(3); // set the third lap counter
- Delay(kSecond * 2, NULL);
- myTimer.Stop(); // 2 second delay
-
- cout << "Time between start and stop = " << myTimer.GetTicks() << " ticks\n";
- cout << "Or in seconds = " << myTimer.GetSeconds() << " s\n";
- cout << "Lap counter 3 is = " << myTimer.GetLap(3) << " ticks\n";
-
- cout << "End of the TTimer test!\n";
- }
-
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 12/14/92 New file
- 2 khs 1/3/93 Cleanup
- */
-